package com.emersonprocess.danpacmobile.dao;


public class DataRetriever {

	// production - http://www.wrcrossref.com/wrmobileservice/
	// staging - http://stage.wrcrossref.com/wrmobileservice/
	private final String rootURL = "http://www.wrcrossref.com/wrmobileservice/";

	public DataRetriever() {
		super();
	}

//	public ResponseObject getOemList() throws Exception {
//		// Create a new HttpClient and Post Header
//		HttpClient httpclient = new DefaultHttpClient();
//
//		HttpPost httppost = new HttpPost(rootURL + "wroemgenerichandler.ashx");
//
//		// Add your data
//		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(1);
//		nameValuePairs.add(new BasicNameValuePair("transact", "searchOEMList"));
//		httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//
//		// Execute HTTP Post Request
//		HttpResponse response = httpclient.execute(httppost);
//		HttpEntity entity = response.getEntity();
//		String responseText = EntityUtils.toString(entity);
//
//		Gson gson = new Gson();
//		ResponseObject ro = gson.fromJson(responseText, ResponseObject.class);
//		return ro;
//	}
//
//	public ResponseObject getOemProductList(String oemId) throws Exception {
//		// Create a new HttpClient and Post Header
//		HttpClient httpclient = new DefaultHttpClient();
//
//		HttpPost httppost = new HttpPost(rootURL + "wroemgenerichandler.ashx");
//
//		// Add your data
//		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//		nameValuePairs.add(new BasicNameValuePair("transact", "searchOEMProducts"));
//		nameValuePairs.add(new BasicNameValuePair("OEMID", oemId));
//		httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//
//		// Execute HTTP Post Request
//		HttpResponse response = httpclient.execute(httppost);
//		HttpEntity entity = response.getEntity();
//		String responseText = EntityUtils.toString(entity);
//
//		Gson gson = new Gson();
//		ResponseObject ro = gson.fromJson(responseText, ResponseObject.class);
//		return ro;
//	}
//
//	public ResponseObject getOEMRelatedProducts(int prodTypeId, int prodId) throws Exception {
//		// Create a new HttpClient and Post Header
//		HttpClient httpclient = new DefaultHttpClient();
//
//		HttpPost httppost = new HttpPost(rootURL + "wroemgenerichandler.ashx");
//
//		// Add your data
//		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//		nameValuePairs.add(new BasicNameValuePair("transact", "searchOEMRelatedProducts"));
//		nameValuePairs.add(new BasicNameValuePair("OEMProductTypeID", String.valueOf(prodTypeId)));
//		nameValuePairs.add(new BasicNameValuePair("OEMProductID", String.valueOf(prodId)));
//		httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//
//		// Execute HTTP Post Request
//		HttpResponse response = httpclient.execute(httppost);
//		HttpEntity entity = response.getEntity();
//		String responseText = EntityUtils.toString(entity);
//
//		Gson gson = new Gson();
//		ResponseObject ro = gson.fromJson(responseText, ResponseObject.class);
//		return ro;
//	}
//
//	public ResponseObject getOEMProductDetails(int prodTypeId, int emersonProdId) throws Exception {
//		// Create a new HttpClient and Post Header
//		HttpClient httpclient = new DefaultHttpClient();
//
//		HttpPost httppost = new HttpPost(rootURL + "wroemgenerichandler.ashx");
//
//		// Add your data
//		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//		nameValuePairs.add(new BasicNameValuePair("transact", "getProductDetails"));
//		nameValuePairs.add(new BasicNameValuePair("ProductTypeID", String.valueOf(prodTypeId)));
//		nameValuePairs.add(new BasicNameValuePair("EmersonProductID", String.valueOf(emersonProdId)));
//		httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//
//		// Execute HTTP Post Request
//		HttpResponse response = httpclient.execute(httppost);
//		HttpEntity entity = response.getEntity();
//		String responseText = EntityUtils.toString(entity);
//
//		Gson gson = new Gson();
//		ResponseObject ro = gson.fromJson(responseText, ResponseObject.class);
//		return ro;
//	}
//
//	public ResponseObject getOEMProductByDescription(String productName) throws Exception {
//		// Create a new HttpClient and Post Header
//		HttpClient httpclient = new DefaultHttpClient();
//
//		HttpPost httppost = new HttpPost(rootURL + "wroemgenerichandler.ashx");
//
//		// Add your data
//		List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
//		nameValuePairs.add(new BasicNameValuePair("transact", "searchOEMProductsByDescription"));
//		nameValuePairs.add(new BasicNameValuePair("OEMProduct", productName));
//		httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
//
//		// Execute HTTP Post Request
//		HttpResponse response = httpclient.execute(httppost);
//		HttpEntity entity = response.getEntity();
//		String responseText = EntityUtils.toString(entity);
//
//		Gson gson = new Gson();
//		ResponseObject ro = gson.fromJson(responseText, ResponseObject.class);
//		return ro;
//	}

}
